import request from '@/utils/request'

// 查询户管理列表
export function listDoor(query) {
  return request({
    url: '/house/door/list',
    method: 'get',
    params: query
  })
}

// 查询户管理详细
export function getDoor(doorId) {
  return request({
    url: '/house/door/' + doorId,
    method: 'get'
  })
}

// 查询户管理详细
export function getDoorAddr(doorId) {
  return request({
    url: '/house/door/getDoorAddr/' + doorId,
    method: 'get'
  })
}

// 查询户管理详细
export function getDoorFlit(doorId) {
  return request({
    url: '/house/door/' + doorId,
    method: 'get'
  })
}

// 新增户管理
export function addDoor(data) {
  return request({
    url: '/house/door/',
    method: 'post',
    data: data
  })
}


// 修改户管理
export function updateDoorName(data) {
  return request({
    url: '/house/door/updateDoorName/',
    method: 'put',
    data: data
  })
}

// 删除户管理
export function delDoor(doorId) {
  return request({
    url: '/house/door/' + doorId,
    method: 'delete'
  })
}

// 获取小区信息
export function getAreaInfo() {
  return request({
    url: '/house/area/list1',
    method: 'get'
  })
}
// 获取小区信息
export function getAreaInfo1(areaName) {
  return request({
    url: '/house/area/list2/'+areaName,
    method: 'get'
  })
}

// 获取楼宇信息
export function getGroupInfo(areaName) {
  return request({
    url: '/house/group/getGroupInfo/'+areaName,
    method: 'get'
  })
}

// 修改户管理
export function updateDoor(areaName,groupName,unitName,doorName,doorId) {
  return request({
    url: '/house/door/update/'+areaName+"/"+groupName+"/"+unitName+"/"+doorName+"/"+doorId,
    method: 'get'
  })
}

// 获取单元信息
export function getUnitInfo(areaName,groupName) {
  return request({
    url: '/house/unit/getUnitInfo/'+areaName+"/"+groupName,
    method: 'get'
  })
}

// 获取用途信息
export function getPurposeInfo() {
  return request({
    url: '/house/purpose/list',
    method: 'get'
  })
}

// 获取收费标准信息
export function getFeesInfo() {
  return request({
    url: '/house/fees/list',
    method: 'get'
  })
}

// 查询计息列表
export function listRateQuery(query) {
  return request({
    url: '/house/door/listRateQuery',
    method: 'get',
    params: query
  })
}

// 查询维修记录查询列表
export function listRepairQuery(query) {
  return request({
    url: '/repair/repairQuery/list',
    method: 'get',
    params: query
  })
}

// 修改户信息修改
export function updateInfo(data) {
  return request({
    url: '/house/door/updateInfo',
    method: 'put',
    data: data
  })
}

export function getDoorCostList(houseId) {
  return request({
    url: '/house/door/getDoorCostList/' + houseId,
    method: 'get'
  })
}

// 查询户管理详细
export function getDoorCost(costId) {
  return request({
    url: '/house/door/getDoorCost/' + costId,
    method: 'get'
  })
}

export function updateDoorCost(data) {
  return request({
    url:'/house/door/updateDoorCost',
    method: 'put',
    data: data
  })
}


// 查询户参数
export function getParameter(doorId) {
  return request({
    url: '/house/door/getParameter/' + doorId,
    method: 'get'
  })
}

export function updateParameter(data) {
  return request({
    url:'/house/door/updateParameter',
    method: 'put',
    data: data
  })
}


// 查询缴费
export function getCost(doorId) {
  return request({
    url: '/house/door/getCost/' + doorId,
    method: 'get'
  })
}

export function insertCost(data) {
  return request({
    url:'/house/door/insertCost',
    method: 'put',
    data: data
  })
}

export function weChatPay(data) {
  return request({
    url: '/house/door/weChatPay/',
    method: 'put',
    data: data
  })
}

export function getRefundList(houseId) {
  return request({
    url: '/house/door/getRefundList/' + houseId,
    method: 'get'
  })
}

export function getRefund(costId) {
  return request({
    url: '/house/door/getRefund/' + costId,
    method: 'get'
  })
}

export function updateRefund(costId,refundDate) {
  return request({
    url: '/house/door/updateRefund/' + costId+'/'+refundDate,
    method: 'delete'
  })
}


//资金返还
export function delReturn(doorId) {
  return request({
    url: '/house/door/delReturn/' + doorId,
    method: 'delete'
  })
}
